<template>
  <div>
     <home-header :city="city"></home-header>
     <home-swiper :swiperList="swiperList"></home-swiper>
     <home-icons :iconsList="iconList"></home-icons>
     <home-recommend :recommendList="recommendList"></home-recommend>
     <home-weekend :weekendList="weekendList"></home-weekend>
  </div>
</template>
<script>
import HomeHeader from "./components/HomeHeader";
import HomeSwiper from "./components/HomeSwiper";
import HomeIcons from "./components/HomeIcons";
import HomeRecommend from "./components/HomeRecommend";
import HomeWeekend from "./components/HomeWeekend";
import axios from "axios";
export default {
  name: "home",
  components: {
    HomeHeader,
    HomeSwiper,
    HomeIcons,
    HomeRecommend,
    HomeRecommend,
    HomeWeekend
  },
  data() {
    return {
      city: "西安",
      swiperList: [],
      iconList: [],
      recommendList: [],
      weekendList: []
    };
  },
  methods: {
    getHomeInfo() {
      axios.get("/static/mock/index.json").then(this.getHomeInfoSuccess);
    },
    getHomeInfoSuccess(res) { 
      res =res.data;
      console.log(res);
      if(res.ret&&res.data){
        this.swiperList = res.data.swiperList;
        this.iconList = res.data.iconList;
        this.recommendList = res.data.recommendList;
        this.weekendList = res.data.weekendList;
      }
    }
  },
  mounted() {
    this.getHomeInfo();
  }
};
</script>
<style lang="scss">
.banner-container .swiper-pagination-bullet-active {
  background: #fff !important;
}

.icons .swiper-container {
  height: 0rem;
  padding-bottom: 50%;
  overflow: hidden;
}
</style>

